/**
 * @author lk
 * @date 2022/5/15 21:38
 */
package com.two.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.Optional;

@Controller
public class ParamController {
    @RequestMapping("/testServletAPI")
    public String test1(HttpServletRequest request) {
        String username = request.getParameter("username");
        System.out.println(username);
        return "success";
    }

    @RequestMapping("/testParams")
    public String test2(@RequestParam("username_") String username, HttpServletRequest request) {
        System.out.println(username);
        return "success";
    }



}
